<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FreeRTOS Addons: cpp_freertos::MutexRecursive Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FreeRTOS Addons
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacecpp__freertos.html">cpp_freertos</a></li><li class="navelem"><a class="el" href="classcpp__freertos_1_1_mutex_recursive.html">MutexRecursive</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classcpp__freertos_1_1_mutex_recursive-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">cpp_freertos::MutexRecursive Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="mutex_8hpp_source.html">mutex.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for cpp_freertos::MutexRecursive:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classcpp__freertos_1_1_mutex_recursive.png" usemap="#cpp_5Ffreertos::MutexRecursive_map" alt=""/>
  <map id="cpp_5Ffreertos::MutexRecursive_map" name="cpp_5Ffreertos::MutexRecursive_map">
<area href="classcpp__freertos_1_1_mutex.html" alt="cpp_freertos::Mutex" shape="rect" coords="0,0,181,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a426901660c5879b1c0a98f040be36b2f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_mutex_recursive.html#a426901660c5879b1c0a98f040be36b2f">MutexRecursive</a> ()</td></tr>
<tr class="separator:a426901660c5879b1c0a98f040be36b2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a751e5af8f8af53de3822cc7c0f2c905e"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_mutex_recursive.html#a751e5af8f8af53de3822cc7c0f2c905e">Lock</a> (TickType_t Timeout=portMAX_DELAY)</td></tr>
<tr class="separator:a751e5af8f8af53de3822cc7c0f2c905e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a99fa48374855689b546d4034fb458321"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_mutex_recursive.html#a99fa48374855689b546d4034fb458321">Unlock</a> ()</td></tr>
<tr class="separator:a99fa48374855689b546d4034fb458321"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classcpp__freertos_1_1_mutex"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcpp__freertos_1_1_mutex')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classcpp__freertos_1_1_mutex.html">cpp_freertos::Mutex</a></td></tr>
<tr class="memitem:ac9e9182407f5f74892318607888e9be4 inherit pub_methods_classcpp__freertos_1_1_mutex"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_mutex.html#ac9e9182407f5f74892318607888e9be4">~Mutex</a> ()</td></tr>
<tr class="separator:ac9e9182407f5f74892318607888e9be4 inherit pub_methods_classcpp__freertos_1_1_mutex"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad32b3657e5bab97b248273e80c0c3ae7 inherit pub_methods_classcpp__freertos_1_1_mutex"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_mutex.html#ad32b3657e5bab97b248273e80c0c3ae7">Lock</a> (TickType_t Timeout=portMAX_DELAY)=0</td></tr>
<tr class="separator:ad32b3657e5bab97b248273e80c0c3ae7 inherit pub_methods_classcpp__freertos_1_1_mutex"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9acd81676fcd099254ecca161d51a4a3 inherit pub_methods_classcpp__freertos_1_1_mutex"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_mutex.html#a9acd81676fcd099254ecca161d51a4a3">Unlock</a> ()=0</td></tr>
<tr class="separator:a9acd81676fcd099254ecca161d51a4a3 inherit pub_methods_classcpp__freertos_1_1_mutex"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_methods_classcpp__freertos_1_1_mutex"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classcpp__freertos_1_1_mutex')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classcpp__freertos_1_1_mutex.html">cpp_freertos::Mutex</a></td></tr>
<tr class="memitem:a593423d868daf926c7b0d63a833ae29a inherit pro_methods_classcpp__freertos_1_1_mutex"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_mutex.html#a593423d868daf926c7b0d63a833ae29a">Mutex</a> ()</td></tr>
<tr class="separator:a593423d868daf926c7b0d63a833ae29a inherit pro_methods_classcpp__freertos_1_1_mutex"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classcpp__freertos_1_1_mutex"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classcpp__freertos_1_1_mutex')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classcpp__freertos_1_1_mutex.html">cpp_freertos::Mutex</a></td></tr>
<tr class="memitem:a639327163cdbee7b3847982d49b2fe03 inherit pro_attribs_classcpp__freertos_1_1_mutex"><td class="memItemLeft" align="right" valign="top">SemaphoreHandle_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_mutex.html#a639327163cdbee7b3847982d49b2fe03">handle</a></td></tr>
<tr class="separator:a639327163cdbee7b3847982d49b2fe03 inherit pro_attribs_classcpp__freertos_1_1_mutex"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Recursive usage <a class="el" href="classcpp__freertos_1_1_mutex.html">Mutex</a>.</p>
<p >By default calls to Lock these objects block forever, but this can be changed by simply passing in a argument to the <a class="el" href="classcpp__freertos_1_1_mutex_recursive.html#a751e5af8f8af53de3822cc7c0f2c905e">Lock()</a> method. These objects are recursively acquirable. Calling <a class="el" href="classcpp__freertos_1_1_mutex_recursive.html#a751e5af8f8af53de3822cc7c0f2c905e">Lock()</a> twice from the same <a class="el" href="classcpp__freertos_1_1_thread.html">Thread</a> (i.e. task) works fine. The caller just needs to be sure to call <a class="el" href="classcpp__freertos_1_1_mutex_recursive.html#a99fa48374855689b546d4034fb458321">Unlock()</a> as many times as <a class="el" href="classcpp__freertos_1_1_mutex_recursive.html#a751e5af8f8af53de3822cc7c0f2c905e">Lock()</a>.</p>
<dl class="section note"><dt>Note</dt><dd>Recursive mutexes use more resources than standard mutexes. You should be sure that you actually need this type of synchronization before using it. </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a426901660c5879b1c0a98f040be36b2f" name="a426901660c5879b1c0a98f040be36b2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a426901660c5879b1c0a98f040be36b2f">&#9670;&#160;</a></span>MutexRecursive()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">MutexRecursive::MutexRecursive </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Create a recursize <a class="el" href="classcpp__freertos_1_1_mutex.html">Mutex</a>.</p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ThreadMutexException</td><td>on failure. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a751e5af8f8af53de3822cc7c0f2c905e" name="a751e5af8f8af53de3822cc7c0f2c905e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a751e5af8f8af53de3822cc7c0f2c905e">&#9670;&#160;</a></span>Lock()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool MutexRecursive::Lock </td>
          <td>(</td>
          <td class="paramtype">TickType_t&#160;</td>
          <td class="paramname"><em>Timeout</em> = <code>portMAX_DELAY</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >Lock the <a class="el" href="classcpp__freertos_1_1_mutex.html">Mutex</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Timeout</td><td>How long to wait to get the Lock until giving up. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the Lock was acquired, false if it timed out. </dd></dl>

<p>Implements <a class="el" href="classcpp__freertos_1_1_mutex.html#ad32b3657e5bab97b248273e80c0c3ae7">cpp_freertos::Mutex</a>.</p>

</div>
</div>
<a id="a99fa48374855689b546d4034fb458321" name="a99fa48374855689b546d4034fb458321"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a99fa48374855689b546d4034fb458321">&#9670;&#160;</a></span>Unlock()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool MutexRecursive::Unlock </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >Unlock the <a class="el" href="classcpp__freertos_1_1_mutex.html">Mutex</a>.</p>
<dl class="section return"><dt>Returns</dt><dd>true if the Lock was released, false if it failed. (Hint, if it fails, did you call <a class="el" href="classcpp__freertos_1_1_mutex_recursive.html#a751e5af8f8af53de3822cc7c0f2c905e">Lock()</a> first?) </dd></dl>

<p>Implements <a class="el" href="classcpp__freertos_1_1_mutex.html#a9acd81676fcd099254ecca161d51a4a3">cpp_freertos::Mutex</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="mutex_8hpp_source.html">mutex.hpp</a></li>
<li>src/freertos-addon/c++/cmutex.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
